import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import Sales from '../../../../components/shop/Sales';
import { AudioOutlined } from '@ant-design/icons';
import { Input, Space } from 'antd';

export const index = ({ offhiredata, dispatch }: any) => {
  const { Search } = Input;
  const onSearch = (value: string) => {
    dispatch({ type: 'offslaes/OFFHIRESEARCH', payload: value });
  };
  // useEffect(()=>{
  //  dispatch({type:'offslaes/GETOFFHIRE'})
  // },[])
  return (
    <div>
      <h3>写字楼出租</h3>
      <Search
        style={{ width: '400px' }}
        placeholder="input search text"
        allowClear
        enterButton="Search"
        size="large"
        onSearch={onSearch}
      />
      <Sales datalist={offhiredata} deltype={2} flag={true}></Sales>
    </div>
  );
};

const mapStateToProps = ({ offslaes: { offhiredata } }: any) => {
  // console.log(offsldata)
  return {
    offhiredata,
  };
};

export default connect(mapStateToProps)(index);
